<template>
  <div>
    <!-- 动态组件 比v-if更方便 节省代码 -->
    <button @click="msg='zujian1Vue'">小可爱</button>
    <button @click="msg='zujian2Vue'">大美美</button>
    <component :is="msg"></component>
  </div>
</template>

<script>
import zujian1Vue from "./components/zujian1.vue";
import zujian2Vue from "./components/zujian2.vue";
export default {
  components: {
    zujian1Vue,
    zujian2Vue
  },
  data() {
    return {
      msg: "zujian1Vue",
    };
  },
};
</script>

<style>
</style>